# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Maintainer: Ray Donnelly <ray.donnelly@gmail.com>

_realname=gyp
pkgname=${_realname}-git
pkgver=r2114.a2738d85
pkgrel=1
pkgdesc="GYP can Generate Your Projects."
url="https://code.google.com/p/gyp/"
arch=('i686' 'x86_64')
provides=("gyp")
conflicts=("gyp")
replaces=("gyp-svn")
makedepends=('git')
depends=('python2' 'python2-setuptools')
license=('custom')
source=("git+https://chromium.googlesource.com/external/gyp"
        '0001-msys-ize.patch')
sha256sums=('SKIP'
            '47629f3e86a163c366d4e7494b94f544a70973ec7c4bdbe0dcdd2246660693ce')

pkgver() {
  cd "${srcdir}"/${_realname}
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${srcdir}"/${_realname}
  git am --committer-date-is-author-date "${srcdir}"/0001-msys-ize.patch
  
  #https://codereview.chromium.org/2019133002/
  #patch -p1 -i "${srcdir}"/issue2019133002_1.diff
}

package() {
  cd "${srcdir}"/${_realname}
  python2 setup.py install --root="${pkgdir}"
}
